import React from 'react';
import './App.css';

import { ConfigProvider } from 'antd'

import zhCN from 'antd/es/locale/zh_CN'

import { Provider } from 'react-redux'
import store from './store'

import {BrowserRouter, Route, Switch, Redirect} from 'react-router-dom'

import Login from './pages/login/index'

import Main from './pages/main/index'

import Article from './pages/article/index'


function App() {

	return (
		<div className="App">
			<ConfigProvider locale={zhCN}>
				<Provider store={store}>
					<BrowserRouter>
						<Switch>
							<Route path="/" exact render={() => <Redirect to="article"></Redirect>}></Route>
							<Route path="/article" component={Article}></Route>
							<Route path="/main" render={() => <Main></Main>}></Route>
							<Route path="/login" component={Login}></Route>
							<Route render={() => <Redirect to="/main/page404"></Redirect>}></Route>
						</Switch>
					</BrowserRouter>
				</Provider>
			</ConfigProvider>
		</div>
	);
}

export default App;
